import request from '@/utils/request'

// CRP 培养模块
export const getCrpModule = (page, size, searchText) => {
  return request.get("/crp-module-list", { params: { page: page, size: size, key: searchText } })
}

export const getCrpModuleById = (id) => {
  return request.get("/crp-module/" + id)
}

export const addCrpModule = (data) => {
  return request.post("/crp-module-add", data)
}

export const updateCrpModule = (data) => {
  return request.post("/crp-module-update", data)
}

export const deleteCrpModule = (id) => {
  return request.delete("/crp-module-delete/" + id)
}



// CRP 培养项目
export const getCrpItem = (page, size, searchText, moduleId) => {
  return request.get("/crp-item-list", { params: { page: page, size: size, key: searchText, mid: moduleId } })
}

export const getCrpItemById = (id) => {
  return request.get("/crp-item/" + id)
}

export const addCrpItem = (data) => {
  return request.post("/crp-item-add", data)
}

export const updateCrpItem = (data) => {
  return request.post("/crp-item-update", data)
}

export const deleteCrpItem = (id) => {
  return request.delete("/crp-item-delete/" + id)
}


// 班级管理
export const getClass = (page, size, searchText) => {
  return request.get("/class-list", { params: { page: page, size: size, key: searchText } })
}

export const getClassById = (id) => {
  return request.get("/class/" + id)
}

export const addClass = (data) => {
  return request.post("/class-add", data)
}

export const updateClass = (data) => {
  return request.post("/class-update", data)
}

export const deleteClass = (id) => {
  return request.delete("/class-delete/" + id)
}


// 学生管理
export const getStudent = (page, size, searchText, classId) => {
  return request.get("/student-list", { params: { page: page, size: size, key: searchText, cid: classId } })
}

export const getStudentById = (id) => {
  return request.get("/student/" + id)
}

export const addStudent = (data) => {
  return request.post("/student-add", data)
}

export const updateStudent = (data) => {
  return request.post("/student-update", data)
}

export const deleteStudent = (id) => {
  return request.delete("/student-delete/" + id)
}


// 部门管理
export const getDepartment = (page, size, searchText) => {
  return request.get("/department-list", { params: { page: page, size: size, key: searchText } })
}

export const getDepartmentById = (id) => {
  return request.get("/department/" + id)
}

export const addDepartment = (data) => {
  return request.post("/department-add", data)
}

export const updateDepartment = (data) => {
  return request.post("/department-update", data)
}

export const deleteDepartment = (id) => {
  return request.delete("/department-delete/" + id)
}


// ---------------------- 班级管理员 ----------------------
